ELEMENTS

Editing
  • account_tree
  • bug_report

<td>

데이터를 입력하는 데이터 셀(cell)을 나타낸다.

  • 콘텐츠 분류

    NONE

  • 허용된 부모 요소 또는 위치

    <TR>

  • 콘텐츠 모델

  • 태그 생략

    종료 태그 생략 가능

    <td> 요소 바로 뒤에 다른 <td> 요소 또는 <th> 요소가 오거나 이후에 더 이상의 상위 요소의 콘텐츠가 없는 경우 종료 태그를 생략할 수 있다.

  • DOM Interface

    HTMLTableCellElement

    [Exposed=Window]
    interface HTMLTableCellElement : HTMLElement {
      [HTMLConstructor] constructor();
    
      [CEReactions] attribute unsigned long colSpan;
      [CEReactions] attribute unsigned long rowSpan;
      [CEReactions] attribute DOMString headers;
      readonly attribute long cellIndex;
    
      [CEReactions] attribute DOMString scope; // only conforming for th elements
      [CEReactions] attribute DOMString abbr;  // only conforming for th elements
    
      // also has obsolete members
    };

구문

마크업 형식
<table> <tr> <td></td> <td></td> </tr>
</table>

애트리뷰트

colspan non-negative integers

열 방향으로 셀이 확장되는 개수를 설정한다.

About Non-negative integers

음수가 아닌 유효한 정수를 나타낸다.

구문 예

공통으로 사용하는 애트리뷰트의 경우 구문에 사용된 요소가 다를 수 있다.

구문 형식
colspan="[1,1000]"

사용 예

rowspan non-negative integers

행 방향으로 셀이 확장되는 개수를 설정한다.

About Non-negative integers

음수가 아닌 유효한 정수를 나타낸다.

구문 예

공통으로 사용하는 애트리뷰트의 경우 구문에 사용된 요소가 다를 수 있다.

구문 형식
rowspan="[0,65534]"

0은 셀이 나머지 모든 행에 걸쳐 있음을 의미한다.

사용 예


rowspan 값이 0인 경우
headers unordered set of unique space-separated tokens

접근성을 위한 애트리뷰트로서 해당 셀의 데이터와 연관된 <thead> 요소 그룹에 정의된 <th> 요소의 id를 공백으로 구분된 토큰 형식으로 작성한다. 시각적 효과가 없지만 접근성을 위한 다양한 장치에 의해서 사용된다.

About Unordered set of unique space-separated tokens

순서가 없는 공백으로 구분된 고유한 토큰 세트를 나타낸다.

사용 예

<table>
  <thead>
    <tr>
      <th id="name">Name</th>
      <th id="age">Age</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td headers="name">Tom</td>
      <td headers="age">26</td>
    </tr>
  </tbody>
</table>

글로벌 애트리뷰트

일부 글로벌 애트리뷰트는 이 요소에서 사용되지 않을 수 있다.

글로벌 이벤트 핸들러

일부 글로벌 이벤트 핸들러는 이 요소에서 사용되지 않을 수 있다. 이벤트 등록은 자바스크립트 사용을 권장한다.

버전 명세

HTML Standard
#the-td-element

지원 웹브라우저